package com.cfh.springcloudclientapplication;


import com.cfh.springcloudclientapplication.customclient.EnableRestClients;
import com.cfh.springcloudclientapplication.remoteevent.HttpRemoteAppEventListener;
import com.cfh.springcloudclientapplication.service.SayingRestService;
import com.cfh.springcloudclientapplication.stream.SimpleMessageSource;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.naming.Name;


@SpringBootApplication
@EnableDiscoveryClient
@EnableScheduling
@EnableFeignClients
@EnableRestClients(clients = SayingRestService.class)
@EnableBinding(SimpleMessageSource.class)
public class SpringCloudClientApplication {
    public static void main(String[] args) {
        new SpringApplicationBuilder(SpringCloudClientApplication.class)
                .web(WebApplicationType.SERVLET)
                .listeners(new HttpRemoteAppEventListener())
                .run(args);
    }
}
